<script language="javascript">
$(document).ready(function(){
	$('#ceksemua').click(function () {
		$(".cls_periode").attr('checked', this.checked);
	});
});
</script>
<div id="page-wrapper">
        <!-- /.row -->
    <div class="row">
        <div class="col-sm-12">
			<div class="panel panel-default">
				<div class="panel-heading">
                    <span class="judul-page">Setting Tagihan Pembayaran Tahunan</span>
                    
                    
                </div>
				<div class="clearfix"></div>
			</div>
			<div class="panel panel-default">
				
                <div class="panel-heading"><span class="judul-page">Data Siswa</span><span class="pull-right">
					<a class="btn btn-warning btn-xs" href="<?php echo site_url('pembayaran_tahunan');?>">&nbsp;Kembali</a>
				</span>
				<div class="clearfix"></div>
				</div>
                <div class="panel-body">
				<?php
$flashmessage = $this->session->flashdata('pesan');
$flasherror = $this->session->flashdata('pesan_error');
	//echo ! empty($flashmessage) ? '<div class="valid_box">' . $flashmessage . '</div>': '';
if(! empty($flashmessage)){
?>
<div class="alert alert-success">
    <span class="glyphicon glyphicon-ok"></span>&nbsp;&nbsp;<?php echo $flashmessage;?>
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
</div>
<?php
}
?>
					<table class="table table-striped table-bordered table-hover table-condensed">
							<tr>
								<td style="width:200px;"><span class="pull-left judul-hub">NVA</span></td>
								<td><?php echo $detail_siswa[0]->nis;?></td>
							</tr>
							<tr>
								<td><span class="pull-left judul-hub">Nama</span></td>
								<td><?php echo $detail_siswa[0]->nm_lengkap;?></td>
							</tr>
							<tr>
								<td><span class="pull-left judul-hub">Tahun Ajaran</span></td>
								<td><b><?php echo $tapel['th_ajaran'];?></b></td>
							</tr>
							<tr>
								<td><span class="pull-left judul-hub">Status Tagihan</span></td>
								<td><b><?php echo ($status_aksi=="insert")?'Belum Disetting':'Sudah Disetting';?></b></td>
							</tr>
							
						</table>
				</div>
			</div>
			<div class="panel panel-default">
                <div class="panel-heading"><span class="judul-page">Tagihan Yang Sudah Dibayar</span></div>
                <div class="panel-body">
					<table class="table table-striped table-bordered table-hover table-condensed">
						<thead>
						<tr>
							<th width="20">No</th>
							<th>Tgl Bayar</th>
							<th>Nama Komponen</th>
							<th>Nominal</th>
							<th>Hapus</th>
						</tr>
						</thead>
						<?php
						if(isset($list_lunas)){
							$no=1;
							foreach($list_lunas as $val){
						
						?>
						<tr>
							<td><?php echo $no; ?></td>
							<td><?php echo tgl_indonesia($val['tgl_bayar']);?></td>
							<td><?php echo $val['nama_komp'];?></td>
							<td><?php echo number_format($val['nominal'],0,",",".");?></td>
							<td>
							<a href="<?php echo site_url('pembayaran_tahunan/delete_pembayaran/'.$val['id'].'/'.$nis);?>" onclick="return confirm('Yakin Anda akan menghapus data pembayaran tahunan?')" class="btn btn-danger btn-xs" title="Hapus"><span class="glyphicon glyphicon-trash"></span></a>
							</td>
						</tr>
						
						<?php
						$no++;
						}
						}
						?>
					
					</table>
				</div>
			</div>
			<div class="panel panel-default">
                <div class="panel-heading"><span class="judul-page">Setting Tagihan</span></div>
				<div class="panel-body">
				<form action="<?php echo site_url('pembayaran_tahunan/proses_pembayaran');?>" name="frm_bayar" id="frm_bayar" method="post">
					
					<table class="table table-striped table-bordered table-hover table-condensed">
						<thead>
						<tr>
						
							<th width="15">No</th>
							<th>Nama Komponen</th>
							<th>Nominal</th>
							
						</tr>
						</thead>
						<?php
						if(isset($list_tagihan)){
							$no=1;
							foreach($list_tagihan as $val){
						
						?>
						<tr>
							
							<td><?php echo $no;?></td>
							<td><?php echo $val['nama_komp'];?></td>
							
							<td><input type="text" id="nominal_<?php echo $no;?>" style="width:100px;" class="form-control input-sm" name="nominal[<?php echo $no;?>]" value="<?php echo number_format($val['nominal'],0,",",".");?>" size="20">
							<script language="javascript">
$(document).ready(function(){
	
	$('#nominal_<?php echo $no;?>').autoNumeric({
		aSep: '.', 
		aDec: ','}
	);
});
</script>
							<input type="hidden"  name="komponen[<?php echo $no;?>]" value="<?php echo ($status_aksi=="insert")?$val['id_komponen']:$val['id'];?>" />
							</td>
							
							
						</tr>
						
						<?php
						$no++;
						}
						}
						?>
						
						
					
					</table>
					<div class="form-group" style="display:<?php echo $disp_bayar;?>">
                        <div class="col-sm-offset-2 col-sm-9">
						<input type="hidden" name="status_aksi" value="<?php echo $status_aksi;?>" />
						<input type="hidden" name="nis" value="<?php echo $nis;?>" />
						<input type="hidden" name="id_tapel" value="<?php echo $tapel['id_mr_th_ajaran'];?>" />
						  <input type="submit" value="Simpan" name="kirim" class="btn btn-primary btn-sm">
                          <button type="reset" class="btn btn-danger btn-sm">Reset</button>
                        </div>
                      </div>
				</form>
				</div>
			</div>
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->
